package com.roncoo.education.course.service.feign.biz;

import com.roncoo.education.course.feign.qo.AdvQO;
import com.roncoo.education.course.feign.qo.TagQO;
import com.roncoo.education.course.feign.vo.AdvVO;
import com.roncoo.education.course.feign.vo.TagVo;
import com.roncoo.education.course.feign.vo.UserTagNameVO;
import com.roncoo.education.course.service.dao.AdvDao;
import com.roncoo.education.course.service.dao.TagDao;
import com.roncoo.education.course.service.dao.impl.mapper.entity.Adv;
import com.roncoo.education.course.service.dao.impl.mapper.entity.AdvExample;
import com.roncoo.education.course.service.dao.impl.mapper.entity.AdvExample.Criteria;
import com.roncoo.education.course.service.dao.impl.mapper.entity.Tag;
import com.roncoo.education.system.feign.interfaces.IFeignSys;
import com.roncoo.education.util.aliyun.Aliyun;
import com.roncoo.education.util.aliyun.AliyunUtil;
import com.roncoo.education.util.base.Page;
import com.roncoo.education.util.base.PageUtil;
import com.roncoo.education.util.tools.BeanUtil;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;

/**
 * 广告信息
 *
 * @author wujing
 */
@Component
public class FeignTagBiz {

    @Autowired
    private TagDao dao;

    public Long save(TagQO qo) {
        Tag record = BeanUtil.copyProperties(qo, Tag.class);
        dao.save(record);
        return record.getId();
    }

    public int updateById(TagQO qo) {
        Tag record = BeanUtil.copyProperties(qo, Tag.class);
        return dao.updateById(record);
    }

    public int deleteById(Long id) {
        return dao.deleteById(id);
    }
    
    public List<TagVo> findByTag(){
		return dao.findByTag();
	}

    public ArrayList<UserTagNameVO> userNoByTagId(List<Long> tagId){
        return dao.getUserTagName(tagId);
    }

}
